package com.my;

import com.my.mapper.OrderMapper;
import com.my.mapper.UserMapper;
import com.my.service.UserService;
import com.spring.mybatis.MyFactoryBean;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/6/16 13:50
 */
public class Test {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
        
        
        
        

        UserService userService = applicationContext.getBean(UserService.class);
        
        userService.test();


        System.out.println(applicationContext.getBean("userMapper"));
        // 拿到的是getObject()返回的对象
        //System.out.println(applicationContext.getBean("myFactoryBean"));
        //System.out.println(applicationContext.getBean("userMapper"));
        // 拿到的是FactoryBean的对象
        //System.out.println(applicationContext.getBean("&myFactoryBean"));
    }
    
}
